package com.zzedu.enmuns;

import java.util.Arrays;

/**
 * 系统配置枚举
 */
public enum ConfigEnums {

    /**
     * 初始密码Key
     */
    SYS_USER_INITPASSWORD("sys.user.initPassword", "初始密码Key"),

    /**
     * 时间阈值差(毫秒)
     */
    DIFF_TIMESTAMP("sys.app.diff.timestamp","时间阈值差(毫秒)"),

    /**
     * 检查上传媒体文件大小
     */
    CHECK_MEDIA_FLAG("sys.app.check.media.flag","检查上传媒体文件大小"),


    ;

    ConfigEnums(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private String code;

    private String desc;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }


    public static ConfigEnums getCode(String code) {

        return Arrays.stream(ConfigEnums.values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(null);
    }
}
